#include <iostream>

using namespace std;

int main ()

{
   string palabra1, palabra2;
   int R, R2, R3, R4;

   cout << "Ingrese la primer palabra: ";
   cin >> palabra1;


   cout << "Ingrese la segunda palabra: ";
   cin >> palabra2;

   R = palabra1.length();
   R2 = palabra2.length();
   R3 = (R - 1);
   R4 = (R2 - 1);

   if (palabra1 [R3] == palabra2 [R4])
   {
       cout << "Las ultimas letras coinciden" ;
   }
   else
   {
      cout << "Las ultimas letras no coinciden";
   }

    return 1;


}
